package com.micro.school.system.service.impl;

import java.util.List;

import com.micro.school.common.core.context.SecurityContextHolder;
import com.micro.school.common.security.utils.SecurityUtils;
import com.micro.school.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.micro.school.system.mapper.DiscountStudentMapper;
import com.micro.school.system.domain.DiscountStudent;
import com.micro.school.system.domain.vo.DiscountStudentVo;
import com.micro.school.system.convert.discount.DiscountStudentConvert;
import com.ruoyi.system.service.IDiscountStudentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author rakic
 * @date 2025-08-05
 */
@Service
public class DiscountStudentServiceImpl extends ServiceImpl<DiscountStudentMapper,DiscountStudent> implements IDiscountStudentService
{
    @Autowired
    private DiscountStudentMapper discountStudentMapper;

    /**
     * 查询【请填写功能名称】
     * 
     * @param id 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public DiscountStudentVo selectDiscountStudentById(Long id)
    {

        return discountStudentMapper.selectDiscountStudentById(id, Integer.parseInt(SecurityContextHolder.getUserTenantId()));
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param discountStudentVo 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<DiscountStudentVo> selectDiscountStudentList(DiscountStudentVo discountStudentVo)
    {
        return discountStudentMapper.selectDiscountStudentList(discountStudentVo);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param discountStudentVo 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertDiscountStudent(DiscountStudentVo discountStudentVo)
    {
        DiscountStudent discountStudent = DiscountStudentConvert.INSTANCE.convert(discountStudentVo);


        return discountStudentMapper.insert(discountStudent);

    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param discountStudentVo 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateDiscountStudent(DiscountStudentVo discountStudentVo)
    {
        DiscountStudent discountStudent = DiscountStudentConvert.INSTANCE.convert(discountStudentVo);
        return discountStudentMapper.updateDiscountStudent(discountStudent);
    }

    /**
     * 批量删除【请填写功能名称】
     * 
     * @param ids 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteDiscountStudentByIds(List<Long> ids)
    {

        return discountStudentMapper.deleteDiscountStudentByIds(ids, Integer.parseInt(SecurityContextHolder.getUserTenantId()));
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param id 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteDiscountStudentById(Long id)
    {

        return discountStudentMapper.deleteDiscountStudentById(id, Integer.parseInt(SecurityContextHolder.getUserTenantId()));
    }

}
